package com.bracketbird.client.model;

import com.bracketbird.client.model.keys.PlayingTeamId;


/**
 *
 */
public class SeedingTeam extends PlayingTeam {
    private static final long serialVersionUID = -8413373363468003258L;
    private static int idCount = 1;
    private int seed;
    private String nameSeed;

    public SeedingTeam() {
        super();
        setId(new PlayingTeamId("seedingTeamId "+idCount++));

    }

    public SeedingTeam(String sname) {
        nameSeed = sname;
        setTeamName(nameSeed);
        setId(new PlayingTeamId("seedingTeamId "+idCount++));
    }

    public SeedingTeam(int seed) {
        super();
        this.seed = seed;
        this.nameSeed = "Seed "+seed;
        setTeamName(nameSeed);
        setId(new PlayingTeamId("seedingTeamId "+idCount++));
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }

        SeedingTeam that = (SeedingTeam) o;

        if (seed != that.seed) {
            return false;
        }
        if (!nameSeed.equals(that.nameSeed)) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + seed;
        result = 31 * result + nameSeed.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "SeedingTeam{" +
                "nameSeed='" + nameSeed + '\'' +
                '}';
    }
}
